package com.jumi.microservice.material.service;

import com.github.pagehelper.PageInfo;
import com.jumi.microservice.material.domain.JmMaterialSmallUnit;
import com.jumi.microservice.material.dto.JmUnitResponse;

import java.util.Date;
import java.util.List;

/**
 * @description: 商品最小单位组件Service接口
 * @author: ZhangY
 */
public interface JmMaterialSmallUnitService
{
	/**
	 * @Description: 分页+条件查询所有
	 * @Param: [page, size, smunitName, smunitStatus, beginTime, endTime]
	 * @Return: com.github.pagehelper.PageInfo<com.jumi.microservice.material.domain.Smunit>
	 */
	PageInfo<JmMaterialSmallUnit> findAll(Integer page, Integer size, String smunitName, Integer smunitStatus, Date beginTime, Date endTime);

	/**
	 * @Description: 根据id查询
	 * @Param: [smunitId]
	 * @Return: com.jumi.microservice.material.domain.Smunit
	 */
	JmMaterialSmallUnit findById(Integer smunitId);

	/**
	 * @Description: 增加一条
	 * @Param: [smunit]
	 * @Return: int
	 */
	int add(JmMaterialSmallUnit smunit);

	/**
	 * @Description: 更新一条
	 * @Param: [smunit]
	 * @Return: int
	 */
	int update(JmMaterialSmallUnit smunit);

	/**
	 * @Description: 根据id删除一条
	 * @Param: [smunitId]
	 * @Return: int
	 */
	int deleteByIds(String[] ids, String updateBy);

	/**
	 * @Description: 根据id设置启动状态
	 * @Param: [smunitId, smunitStatus]
	 * @Return: int
	 */
	int setStatus(Integer smunitId, Integer smunitStatus, String updateBy);

	/**
	 * @Description: 根据unitIds查询单位列表
	 * @Param unitIds
	 * @Return {@link List<  JmUnitResponse >}
	 * @Throws
	 * @Author Abel Yang
	 * @Date 2020/8/20/020 15:46
	 */
	List<JmUnitResponse> findByUnitIds(List<Integer> unitIds);
}
